#include "StdAfx.h"
#include "SerialLibrary/SerialMFC.h"
#include "Writer.h"
#include <boost/foreach.hpp>
using namespace boost;

Writer::Writer(void)
{
}

Writer::~Writer(void)
{
}

bool Writer::WriteData( CSerialMFC* varSerialPort )
{
	if (varSerialPort->IsOpen())
	{
		BOOST_FOREACH(std::string  str,m_DownLoadDataList)
		{
			varSerialPort->Write(str.c_str(),str.size());
		}
		
		return true;
	}
	else
	{
		return false;
	}
}